import request from '@/utils/http'

// 根据机台号数组 获取整机状态
export function getJiTaiZhuangTai(data) {
  return request.request({
    url: '/api/v3.1/business/position-info/list-machine-break-realtime',
    method: 'post',
    data
  })
}

// 根据机台获取历史状态
export function getLiShiZhuangTai(jiTaiId) {
  return request.request({
    url: '/api/v3.1/business/position-info/position-break-realtime/' + jiTaiId,
    method: 'get'
  })
}

// 获取车间断头概况
export function getDuanTouGaiKuangList() {
  return request.request({
    url: '/api/v3.1/business/position-info/machine-break-realtime-sum',
    method: 'get'
  })
}

// 断头(弱捻)情况
export function getRuoNianList(data) {
  return request.request({
    url: '/api/v3.1/business/position-info/overtime',
    method: 'post',
    data
  })
}

// -----------------------------------工况详情---------------------------------
// 根据车间、大机型，查询在纺物料和机台的对应关系
export function getwuLiaoAndJiTai(gongYiName) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rttemp/material-and-deviceinfo-real-ui?craftNodeName=' +
      gongYiName,
    method: 'get'
  })
}

// 根据工艺节点、区域id，查询在纺物料和机台的对应关系-UI用
export function getwuLiaoAndJiTai_qy(gongYiName, areaId) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rttemp/material-and-deviceinfo-real-ui/' +
      areaId +
      '?craftNodeName=' +
      gongYiName,
    method: 'get'
  })
}

// 根据机台，查询对应的实时数据
export function postJiTaiHuoQuList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/list-machine-rttemp-ui',
    method: 'post',
    data
  })
}

// 织机工序-工况详情
export function postZhiJiGongKuangXiangQing(data) {
  return request.request({
    url: '/api/v3.1/business/loom-production-monitoring/list-loom-machine-rttemp-ui',
    method: 'post',
    data
  })
}

// -----------------------------------单锭统计---------------------------------
// 指定开始时间、结束时间和物料id,查询单锭统计信息
export function getTongJiList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-break-report/position-statistics',
    method: 'post',
    data
  })
}

// -----------------------------------落纱预测---------------------------------

// 指定车间，指定机型下 落纱预测
export function getLuoShaYuCeList(data) {
  return request.request({
    url: '/api/v3.1/business/doffing-approach/doffing-approach/' + data.craftNodeId,
    method: 'get'
  })
}

// 指定工艺节点id、tsid获取日报
export function getHuoQuRiBao(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/machine-daily-report?craftNodeName=' +
      data.craftNodeName +
      '&tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

// 指定车间，指定机型下 落纱预测
export function getXiShaZaiFangPinZhong(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/machine-report-by-material?craftNodeName=' +
      data.craftNodeName,
    method: 'get'
  })
}

// -----------------------------------单锭分析---------------------------------
// 细纱落后锭报表
export function postLuoHouDingList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-break-report/behind-spindle',
    method: 'post',
    data
  })
}

// 细纱留头率报表
export function postLiuTouLvList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-break-report/doffing-rate',
    method: 'post',
    data
  })
}

// 细纱留头率报表
export function postQuShiTuHttp(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-break-report/break-cnt-per-kilo-chart',
    method: 'post',
    data
  })
}

// 单锭分析-一络纱断头率分析-络纱断头率分析
export function postLuoShaFenXi(data) {
  return request.request({
    url: '/api/v3.1/business/machine-spinning-process-xS/machine-spinning-process-xs',
    method: 'post',
    data
  })
}

// 单锭分析-一络纱断头率分析-断纱事件散点分析图
export function getLuoShaShanDianTu(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-spinning-process-xS/break-scatter-point/' +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end,
    method: 'get'
  })
}

// -----------------------------------细纱 络筒 清梳联 粗纱 并条 条并卷  状态总览接口---------------------------------
// 状态总览-最后两个Chart(目前通用各工序)
export function getZongLanEChartList(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/status-chart?machineDocument=' +
      data.machineDocument,
    method: 'get'
  })
}

// 设备监控-织机工序-参数指标-基础信息
export function getZhiJiBase(data) {
  return request.request({
    url:
      '/api/v3.1/business/loom-production-monitoring/loom-current-report?machineDocumentIdInput=' +
      data.machineDocumentIdInput,
    method: 'get'
  })
}

// 状态总览-具体参数指标--细纱
export function getZongLanXiShaShuXin(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/xs-current-report?machineDocumentIdInput=' +
      data.machineDocumentIdInput,
    method: 'get'
  })
}

// 状态总览-具体参数指标--粗纱
export function getZongLanCuShaShuXin(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/xs-current-report?machineDocumentIdInput=' +
      data.machineDocumentIdInput,
    method: 'get'
  })
}

// 状态总览-具体参数指标--并条
export function getZongLanBingTiaoShuXin(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/xs-current-report?machineDocumentIdInput=' +
      data.machineDocumentIdInput,
    method: 'get'
  })
}

// 状态总览-具体参数指标--梳棉
export function getZongLanQingShuLianShuXin(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/xs-current-report?machineDocumentIdInput=' +
      data.machineDocumentIdInput,
    method: 'get'
  })
}

// -----------------------------------粗纱 并条 条并卷 统计接口---------------------------------
// 根据工艺节点，查询在纺物料 UI
export function getShuJuTongJiAndWuLiao(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/materialinfo-real?craftNodeName=' + data.craftNodeName,
    method: 'get'
  })
}

//   ---粗纱---根据物料信息查询产能
export function postCuShaTongJiList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/cs-current-report',
    method: 'post',
    data
  })
}

//   ---并条---根据物料信息查询产能
export function postBingTiaoTongJiList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/cs-current-report',
    method: 'post',
    data
  })
}

// 根据机台，查询对应的五个分类参数数据
export function postChaXunCanShuFeiLei(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-rttemp-paras',
    method: 'post',
    data
  })
}

// 车间状态-获取所有设备的实时数据
export function getMachineRttempAll() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-rttemp-all',
    method: 'get'
  })
}

// 车间状态-状态监视
export function getMachineRttempByCraftNode() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-rttemp-by-craft-node',
    method: 'get'
  })
}

// 车间状态-获取画布和墙体
export function getHuoQuHuaBuList() {
  return request.request({
    url: '/api/v3.1/business/layout-canvas/layout-canvas-list',
    method: 'get'
  })
}

// 车间状态-获取所有机台运行布局信息
export function getHuoQuJiTaiList() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-running-layout',
    method: 'get'
  })
}

// 车间状态-各工序当月产量
export function getGongXuTuBiaoList() {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/month-yarn-weight',
    method: 'get'
  })
}

// 根据工艺节点名称获取状态总览下机台信息
export function getJiTaIZhuangTaiZongLanList(craftId, name) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rttemp/overview-by-craft-node?craftNodeName=' +
      craftId +
      '&teamSet=' +
      name,
    method: 'get'
  })
}

// 细纱工序-单机详情
export function postJiTaiXiangQinList(data, craftNodeName) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-real-info-list?craftNodeName=' + craftNodeName,
    method: 'post',
    data
  })
}

// 指定机台id，查询单机详情
export function getJiTaiXiangQinList(machineDocumentId) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-real-info/' + machineDocumentId,
    method: 'get'
  })
}

// 细采集元数据按照工艺节点分组显示
export function getHuoQuCaiJiList() {
  return request.request({
    url: '/api/v3.0/basic/collect-meta/by-collect-meta-with-craft-node',
    method: 'get'
  })
}

// 车间状态--获取车间布局
export function getHuoQuCheJianBuJu() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-layout',
    method: 'get'
  })
}

// 车间状态--获取机台运行状态
export function getHuoQuYuanXinZhuangTai() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-state',
    method: 'get'
  })
}

// 根据工艺节点名称获取code和name对应关系
export function getCaiJiCanShuGongXu(craftNodeName) {
  return request.request({
    url: '/api/v3.0/basic/collect-meta/by-collect-meta-only-mes?craftNodeName=' + craftNodeName,
    method: 'get'
  })
}

/**
 * 新增自定义报表
 */
export function postZiDingYiBaoBiao(data) {
  return request.request({
    url: '/api/v3.1/business/custom-report-apps',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-整机数据分析-整机数据，整机统计=1，机头故障=3，细络联(大纱库)=4，络筒小车=5
 */
export function postLuoTongZhengJiShuJuFengXi(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report-lt/machine-ht-lt',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-整机数据分析，指定班次、机台，查询整机数据
 */
export function postLuoTongZhengJiShuJuFengXi_LuoTong(data) {
  return request.request({
    url: '/api/v3.1/business/machine-ht-lt/machine-ht-lt',
    method: 'post',
    data
  })
}

/**
 * 赐来福络筒工序-分组数据分析，指定班次、机台，查询分组数据
 */
export function postLuoTongFenZhuTongJi_CiLaiFu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-ht-lt/m-machine-ht-group-lt',
    method: 'post',
    data
  })
}

/**
 * 指定机台、时间，查询一落纱锭速分析趋势图
 */
export function postSpinningQuShiTu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-spinning-process-xS/machine-spinning-process-xs-tendency',
    method: 'post',
    data
  })
}

/**
 * 指定班次、物料，查询锭速分析趋势图
 */
export function postPinZongDingDuQuShiTu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-spinning-process-xS/machine-spinning-process-xs-tendency-by-material-tsid',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-整机数据分析-分组统计
 */
export function getLuoTongZhengJiShuJuFenLei() {
  return request.request({
    url: '/api/v3.0/basic/collect-meta/machine-code-group-ht-ltsync',
    method: 'get'
  })
}

/**
 * 获取租户下络筒状态总览类型
 */
export function getLuoTongZhuangTaiZongLan() {
  return request.request({
    url: '/api/v3.0/basic/lt-set/lt-real-type',
    method: 'get'
  })
}

/**
 * 络筒工序-状态总览-根据数据类型返回络筒实时信息(包含统计信息)
 */
export function getLuoTongStatistics(ltRealTimeDataType) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rttemp/overview-lt-statistics?ltRealTimeDataType=' +
      ltRealTimeDataType,
    method: 'get'
  })
}

/**
 * 络筒工序-整机数据分析-趋势图
 */
export function postLuoTongZhengJiFenXiQuShiTu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report-lt/machine-ht-lt-tendency-chart',
    method: 'post',
    data
  })
}

/**
 * 修改自定义报表
 */
export function putZiDingYiBaoBiao(data) {
  return request.request({
    url: '/api/v3.1/business/custom-report-apps',
    method: 'put',
    data
  })
}

/**
 * 修改自定义报表
 */
export function deleteZiDingYiBaoBiao(baoBiaoID) {
  return request.request({
    url: '/api/v3.1/business/custom-report-apps/' + baoBiaoID,
    method: 'delete'
  })
}

/**
 * 获取该页面该用户下的所有自定义报表
 */
export function getZiDingYiBaoBiaos(data) {
  return request.request({
    url:
      '/api/v3.1/business/custom-report-apps/custom-report-by-page?craftNodeName=' +
      data.craftNodeName +
      '&pageName=' +
      data.pageName,
    method: 'get'
  })
}

/**
 * 将该id的报表设置为默认显示自定义表
 */
export function putSheZhiBaoBiaoWeiMoRen(data) {
  return request.request({
    url:
      '/api/v3.1/business/custom-report-apps/' +
      data.id +
      '/default-display?craftNodeName=' +
      data.craftNodeName +
      '&pageName=' +
      data.pageName,
    method: 'put'
  })
}

/**
 * 络筒工序-状态总览-根据数据类型返回络筒实时信息
 */
export function getLuoTongZongLian(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rttemp/overview-lt?LtRealTimeDataType=' +
      data.LtRealTimeDataType +
      '&GroupNo=' +
      data.GroupNo,
    method: 'get'
  })
}

/**
 * 获取machineRealInfo中settings,retime,process中的参数代码、名称、单位
 */
export function getShiShiZhuangTaiQuanJi(craftNodeId) {
  return request.request({
    url: '/api/v3.1/business/meta-param/meta-param-by-first-type?craftNodeName=' + craftNodeId,
    method: 'get'
  })
}

/**
 * 根据络筒数据分类获取参数信息
 */
export function getLuoTongZongLianCanShuJi(data) {
  return request.request({
    url:
      '/api/v3.1/business/meta-param/meta-param-lt-by-third-type-name?ltRealTimeDataType=' +
      data.ltRealTimeDataType,
    method: 'get'
  })
}

/**
 * 根据机型id和络筒数据类型，获取对应的采集元数据
 */
export function getLuoTongCaiJiShuJuList(machineTypeId, ltDataType) {
  return request.request({
    url:
      '/api/v3.0/basic/collect-meta/lt-meta-by-machine-type-and-data-type/' +
      machineTypeId +
      '?ltDataType=' +
      ltDataType,
    method: 'get'
  })
}

/**
 * 络筒工序-整机详情-根据机台id和参数代码返回实时数据对比分析
 */
export function postZhenJiXiangQinDuiBiData(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-param-comparison',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-单锭详情-详细报表
 */
export function getLuoTongDanDingXiangQin(machineDocumentId) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report-lt/machine-rttemp-spindle-lt/' + machineDocumentId,
    method: 'get'
  })
}

/**
 * 络筒工序-单锭详情-详细报表-赐来福
 */
export function getLuoTongDanDingXiangQinCiLaiFu(machineDocumentId) {
  return request.request({
    url: '/api/v3.1/business/machine-ht-lt/real-time-spindle-autoconer-lt/' + machineDocumentId,
    method: 'get'
  })
}

/**
 * 络筒工序-赐来福分组详情
 */
export function postLuoTongFenZhuXiangQing(data) {
  return request.request({
    url: '/api/v3.1/business/machine-ht-lt/real-time-group-autoconer-lt',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-单锭数据分析-趋势图
 */
export function postLuoTongDanDingXiangQinZhuXingTu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report-lt/machine-spindle-param-comparison',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-单锭数据分析-单锭数据
 */
//  export function getLuoTongDanDingShuJiFenXi(data) {
//    return request.request({
//      url: '/api/v3.1/business/machine-shift-report-lt/machine-ht-spindle-lT?TsIdStart=' + data.TsIdStart + '&TsIdEnd=' + data.TsIdEnd  + '&MachineDocumentId=' + data.MachineDocumentId,
//      method: 'get',
//
//    })
//  }

/**
 * 络筒工序-单锭数据分析，指定班次、机台，查询单锭数据
 */
export function getLuoTongDanDingShuJiFenXi(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-ht-lt/machine-ht-spindle-lT?TsIdStart=' +
      data.TsIdStart +
      '&TsIdEnd=' +
      data.TsIdEnd +
      '&MachineDocumentId=' +
      data.MachineDocumentId +
      '&CustomReportId=' +
      data.CustomReportId,
    method: 'get'
  })
}

/**
 * 络筒工序-单锭数据分析-趋势图
 */
export function postLuoTongDanDingQuShiTuList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report-lt/machine-ht-spindle-lt-tendency-chart',
    method: 'post',
    data
  })
}

/**
 * 络筒工序-根据机台id获取开停车状态
 */
export function postLuoTongKaiTingCheZhuangTai(data) {
  return request.request({
    url: '/api/v3.1/business/machine-run-log/machine-run-state-log-item',
    method: 'post',
    data
  })
}

/**
 * 获取租户下络筒机是细络联还是大纱库（带token访问）
 */
export function getLuoTongCBFpanDuan() {
  return request.request({
    url: '/api/v3.0/basic/machine-document/lt-machine-with-cbf',
    method: 'get'
  })
}

/**
 * 获取清梳联布线图
 */
export function getHuoQuQingShuLianBuJu() {
  return request.request({
    url: '/api/v3.1/business/q-sLGraph/qsl-layout?isActiveTenant=true&tenantid=',
    method: 'get'
  })
}

/**
 * 车间状态-单机详情中-历史状态
 */
export function getDanJiQiangQinLiShi(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-rt/mill-state-machine-rt?machineDocumentId=' +
      data.machineDocumentId +
      '&craftNodeId=' +
      data.craftNodeId +
      '&pageIndex=' +
      data.pageIndex,
    method: 'get'
  })
}

/**
 * 查询租户下已经使用的需要前端搜索用的采集参数列表需要token租户信息
 */
export function getliShiShuJuTuCanShuList(name) {
  return request.request({
    url:
      '/api/v3.0/basic/collect-meta/collect-meta-with-craft-node-machine-list?craftNodeName=' +
      name,
    method: 'get'
  })
}

// 各工序下的历史趋势图
export function postGongXuXiaLiShiQuShiTu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rt/machine-rt-tendency-chart',
    method: 'post',
    data
  })
}

/**
 * 查询租户下已经使用的需要前端搜索用的采集参数列表需要token租户信息
 */
export function getQingHuaXiaBaoKuoDeGongXu() {
  return request.request({
    url: 'api/v3.0/basic/craft-node/by-parent-name-list?craftNodeName=' + '清花',
    method: 'get'
  })
}

/**
 * 查询租户下已经使用的需要前端搜索用的采集参数列表需要token租户信息
 */
export function getQingHuaXiaCanShu() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/overview-qsl',
    method: 'get'
  })
}

/**
 * 清花工序-状态总览下的机台信息(带分区的)
 */
export function getQingHuaXiaCanShu_qy() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/overview-qsl-area',
    method: 'get'
  })
}

/**
 * 设备监控-粗纱工序-数据统计-根据品种查询当班粗纱班报
 */
export function postCuShaShuJuTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/cop-report-cs/cs-cop-report-by-material-tsid',
    method: 'post',
    data
  })
}

/**
 * 设备监控-精梳工序-数据统计-根据品种查询当班精梳班报
 */
export function postJingShuShuJuTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/js-current-report',
    method: 'post',
    data
  })
}

/**
 * 设备监控-预并工序-数据统计-根据品种查询当班预并班报
 */
export function postYuBingShuJuTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/yb-current-report',
    method: 'post',
    data
  })
}

/**
 * 设备监控-梳棉工序-数据统计-根据品种查询当班梳棉班报
 */
export function postShuMianShuJuTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-report/sm-current-report',
    method: 'post',
    data
  })
}

/**
 * 保存租户特性选择--带token访问
 */
export function putBaoCunSheZhiCanShu(data) {
  return request.request({
    url:
      '/api/v3.1/business/tenant-feature/feature-value-description?key=' +
      data.key +
      '&value=' +
      data.value +
      '&description=' +
      data.description,
    method: 'put'
  })
}

/**
 * 根据特性关键字获得特性值--带token访问
 */
export function getBaoCunSheZhiCanShu(data?) {
  return request.request<string>({
    url: '/api/v3.1/business/tenant-feature/feature-value?featureKey=' + data.featureKey,
    method: 'get'
  })
}

/**
 * 落纱记录
 */
export function postHuoQuLouShaJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/doffing-analysis-appservice/doffing-analysis',
    method: 'post',
    data
  })
}

/**
 * 获取达标率
 */
export function getHuoQuDaBiaoLv(data) {
  return request.request({
    url:
      '/api/v3.1/business/doffing-analysis-appservice/doffing-reach-standard?yearMonth=' +
      data.yearMonth,
    method: 'get'
  })
}

/**
 * 根据tsid和机台id获取条桶统计统计报表
 */
export function postHuoQuTiaoTongTongJiListJiTai(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-sm/barrel-report-by-machine-sm',
    method: 'post',
    data
  })
}

/**
 * 根据机台id和时间获取断条统计报表
 */
export function getHuoQuDuanTiaoList(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-sm/break-report?BarrelNo=' +
      data.BarrelNo +
      '&MachineDocumentId=' +
      data.MachineDocumentId +
      '&Start=' +
      data.Start +
      '&End=' +
      data.End,
    method: 'get'
  })
}

/**
 * 根据tsid和品种id获取条桶统计统计报表
 */
export function postHuoQuTiaoTongTongJiListPingZhong(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-sm/barrel-report-by-material-sm',
    method: 'post',
    data
  })
}

/**
 * 更新产量补录记录
 */
export function postChanLiangBulu(data) {
  return request.request({
    url: '/api/v3.1/business/production-replacement/production-replacement',
    method: 'post',
    data
  })
}

/**
 * 获取换班时通信异常的记录
 */
export function getChanLiangBuluList(data) {
  return request.request({
    url:
      '/api/v3.1/business/production-replacement/production-replacement?craftNodeName=' +
      data.craftNodeName +
      '&TsIdStart=' +
      data.TsIdStart +
      '&TsIdEnd=' +
      data.TsIdEnd +
      '&onlyCommunicationAlarm=' +
      data.onlyCommunicationAlarm,
    method: 'get'
  })
}

// -----------------------------------精梳条桶统计接口---------------------------------

/**
 * 精梳条桶统计--根据tsid和物料id获取条桶统计报表
 */
export function postTongJiList_jingShu(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-js/barrel-report-js',
    method: 'post',
    data
  })
}

/**
 * 精梳条桶统计--根据物料和tsid获取故障详细报表
 */
export function getPinZhongQiangQinList_jingShu(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-js/barrel-warning-report-js-by-material-tsid/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 精梳条桶统计--根据机台和tsid获取故障详细报表
 */
export function getJiTaiXiangQinList_jingShu(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-js/barrel-warning-report-js-by-machine-tsid/' +
      data.machineDocumentId +
      '?TsIdStart=' +
      data.tsidStart +
      '&TsIdEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 根据机台id，开始结束时间，详情描述获取故障详细报表；注：品种、通序号和满桶定长前端都之前从表格行中获取，接口中不再赋值
 */
export function getCanShuXiangQinList_jingShu(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-js/barrel-warning-report-js-by-machine-timestamp/' +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end +
      '&description=' +
      data.description,
    method: 'get'
  })
}

// -----------------------------------预并与末并   条桶统计接口---------------------------------
const urlStr = { '11830': 'yb', '11530': 'mb' }
/**
 * 条桶统计--根据tsid和物料id获取条桶统计报表
 */
export function postTongJiList_combine(data, type) {
  return request.request({
    url: `/api/v3.1/business/barrel-report-${urlStr[type]}/barrel-report-${urlStr[type]}`,
    method: 'post',
    data
  })
}
/**
 * 条桶统计--根据物料和tsid获取故障详细报表
 */
export function getPinZhongQiangQinList_combine(data, type) {
  return request.request({
    url:
      `/api/v3.1/business/barrel-report-${urlStr[type]}/barrel-warning-report-${urlStr[type]}-by-material-tsid/` +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 预并条桶统计--根据机台和tsid获取故障详细报表
 */
export function getJiTaiXiangQinList_combine(data, type) {
  return request.request({
    url:
      `/api/v3.1/business/barrel-report-${urlStr[type]}/barrel-warning-report-${urlStr[type]}-by-machine-tsid/` +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 预并条桶统计--根据机台id，开始结束时间，详情描述获取故障详细报表；注：品种、通序号和满桶定长前端都之前从表格行中获取，接口中不再赋值
 */
export function getCanShuXiangQinList_combine(data, type) {
  return request.request({
    url:
      `/api/v3.1/business/barrel-report-${urlStr[type]}/barrel-warning-report-${urlStr[type]}-by-machine-timestamp/` +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end +
      '&description=' +
      data.description +
      '&barrelNo=' +
      data.barrelNo,
    method: 'get'
  })
}

// -----------------------------------预并条桶统计接口---------------------------------

/**
 * 预并条桶统计--根据tsid和物料id获取条桶统计报表
 */
export function postTongJiList_yuBing(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-yb/barrel-report-yb',
    method: 'post',
    data
  })
}

/**
 * 预并条桶统计--根据物料和tsid获取故障详细报表
 */
export function getPinZhongQiangQinList_yuBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-yb/barrel-warning-report-yb-by-material-tsid/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 预并条桶统计--根据机台和tsid获取故障详细报表
 */
export function getJiTaiXiangQinList_yuBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-yb/barrel-warning-report-yb-by-machine-tsid/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 预并条桶统计--根据机台id，开始结束时间，详情描述获取故障详细报表；注：品种、通序号和满桶定长前端都之前从表格行中获取，接口中不再赋值
 */
export function getCanShuXiangQinList_yuBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-yb/barrel-warning-report-yb-by-machine-timestamp/' +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end +
      '&description=' +
      data.description +
      '&barrelNo=' +
      data.barrelNo,
    method: 'get'
  })
}

// -----------------------------------末并条桶统计接口---------------------------------

/**
 * 末并条桶统计--根据tsid和物料id获取条桶统计报表
 */
export function postTongJiList_moBing(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-mb/barrel-report-mb',
    method: 'post',
    data
  })
}

/**
 * 末并条桶统计--根据物料和tsid获取故障详细报表
 */
export function getPinZhongQiangQinList_moBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-mb/barrel-warning-report-mb-by-material-tsid/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 末并条桶统计--根据机台和tsid获取故障详细报表
 */
export function getJiTaiXiangQinList_moBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-mb/barrel-warning-report-mb-by-machine-tsid/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 末并条桶统计--根据机台id，开始结束时间，详情描述获取故障详细报表；注：所有详情=0，断条=1，皮辊缠绵=4;品种、通序号和满桶定长前端都之前从表格行中获取，接口中不再赋值
 */
export function getCanShuXiangQinList_moBing(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-mb/barrel-warning-report-mb-by-machine-timestamp/' +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end +
      '&description=' +
      data.description +
      '&barrelNo=' +
      data.barrelNo,
    method: 'get'
  })
}

// -----------------------------------梳棉条桶统计接口---------------------------------

/**
 * 梳棉条桶统计--根据tsid和物料id获取条桶统计统计报表
 */
export function postTongJiList_shuMian(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-sm/barrel-report-sm1',
    method: 'post',
    data
  })
}

/**
 * 梳棉条桶统计--根据物料和tsid获取故障详细报表
 */
export function getPinZhongQiangQinList_shuMian(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-sm/barrel-warning-report-sm-by-material-tsid/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 梳棉条桶统计--根据机台和tsid获取故障详细报表
 */
export function getJiTaiXiangQinList_shuMian(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-sm/barrel-warning-report-sm-by-machine-tsid/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd,
    method: 'get'
  })
}

/**
 * 梳棉条桶统计--根据机台id，开始结束时间，详情描述获取故障详细报表；注：品种、通序号和满桶定长前端都之前从表格行中获取，接口中不再赋值
 */
export function getCanShuXiangQinList_shuMian(data) {
  return request.request({
    url:
      '/api/v3.1/business/barrel-report-sm/barrel-warning-report-sm-by-machine-timestamp/' +
      data.machineDocumentId +
      '?start=' +
      data.start +
      '&end=' +
      data.end +
      '&description=' +
      data.description,
    method: 'get'
  })
}

/**
 * 精梳工序--按机台统计异常分析
 */
export function postFengXiList_jinShu_jiTai(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-machine-js',
    method: 'post',
    data
  })
}

/**
 * 精梳工序--按机台统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_jinShu_jiTai(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-machine-analysis-detail-js/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

/**
 * 精梳工序--按品种统计异常分析
 */
export function postFengXiList_jinShu_pinZhong(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-material-js',
    method: 'post',
    data
  })
}

/**
 * 精梳工序--按品种统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_jinShu_pinZhong(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-material-analysis-detail-js/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

/**
 * 预并工序--按机台统计异常分析
 */
export function postFengXiList_yuBing_jiTai(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-machine-yb',
    method: 'post',
    data
  })
}

/**
 * 预并工序--按机台统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_yuBing_jiTai(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-machine-analysis-detail-yb/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

/**
 * 预并工序--按品种统计异常分析
 */
export function postFengXiList_yuBing_pinZhong(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-material-yb',
    method: 'post',
    data
  })
}

/**
 * 预并工序--按品种统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_yuBing_pinZhong(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-material-analysis-detail-yb/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

/**
 * 粗纱工序--按机台统计异常分析
 */
export function postFengXiList_cuSha_jiTai(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-machine-cs',
    method: 'post',
    data
  })
}

/**
 * 粗纱工序--按机台统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_cuSha_jiTai(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-machine-analysis-detail-cs/' +
      data.machineDocumentId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

/**
 * 粗纱工序--按品种统计异常分析
 */
export function postFengXiList_cuSha_pinZhong(data) {
  return request.request({
    url: '/api/v3.1/business/abnormal-analysis/abnormal-analysis-by-material-cs',
    method: 'post',
    data
  })
}

/**
 * 粗纱工序--按品种统计异常分析--详细报表，annlysisDescription：所有详情=0，断条=1，牵伸缠绕=2，拥花=3
 */
export function getCanShuXiangQinList_cuSha_pinZhong(data) {
  return request.request({
    url:
      '/api/v3.1/business/abnormal-analysis/abnormal-by-material-analysis-detail-cs/' +
      data.materialId +
      '?tsidStart=' +
      data.tsidStart +
      '&tsidEnd=' +
      data.tsidEnd +
      '&annlysisDescription=' +
      data.annlysisDescription,
    method: 'get'
  })
}

// 根据工艺节点、开始班次、结束班次获取趋势
export function getJinYiYueXiShaQuShi(craftNodeName, tsidStart, tsidEnd) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/efc-run-tendency?CraftNodeName=' +
      craftNodeName +
      '&TsiddStart=' +
      tsidStart +
      '&TsiddEnd=' +
      tsidEnd,
    method: 'get'
  })
}

// 指定班次、工艺节点名称、区域id，查询效率趋势图
export function getJinYiYueXiShaQuShi_qy(craftNodeName, tsidStart, tsidEnd, AreaId) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/efc-run-tendency-by-area?CraftNodeName=' +
      craftNodeName +
      '&TsiddStart=' +
      tsidStart +
      '&TsiddEnd=' +
      tsidEnd +
      '&AreaId=' +
      AreaId,
    method: 'get'
  })
}

// 指定工艺节点名称、开始班次、结束班次，查询机台品种信息
export function getjiTaiPingZhongChaXun(data) {
  return request.request({
    url:
      '/api/v3.1/business/shift-report-condition/machine-material-tree-by-craft-node-tsid?CraftNodeName=' +
      data.craftNodeName +
      '&TsiddStart=' +
      data.TsiddStart +
      '&TsiddEnd=' +
      data.TsiddEnd,
    method: 'get'
  })
}

// 细纱换段预测
export function getXiShaHuanDuanYuCe() {
  return request.request({
    url: '/api/v3.1/business/roving-renew-xs/roving-renew-prediction-xs',
    method: 'get'
  })
}

// 细纱车面上的产量
export function getXiShaCheChanLiang() {
  return request.request({
    url: '/api/v3.1/business/roving-renew-xs/machine-rttemp-online-xs',
    method: 'get'
  })
}

// 细纱分班换段预测
export function getXiShaFenBanHuaDuan() {
  return request.request({
    url: '/api/v3.1/business/roving-renew-xs/roving-renew-prediction-xs-by-tsid',
    method: 'get'
  })
}

// 获取租户的温湿度点位信息 需带token信息
export function getWenShiDuDianWeiXinXi() {
  return request.request({
    url: '/api/v3.0/basic/humidity/humidity-point-list',
    method: 'get'
  })
}

// 指定机台、开始时间、结束时间，查询温湿度历史记录
export function getWenShiDuLiShiQuShi(data) {
  return request.request({
    url:
      '/api/v3.1/business/humiture-rt/humiture-rt/' +
      data.machineDocumentId +
      '?begin=' +
      data.begin +
      '&end=' +
      data.end,
    method: 'get'
  })
}

// 查询温湿度实时数据
export function getShiShiWenShiDu(id) {
  return request.request({
    url: '/api/v3.1/business/humiture-rt-temp/' + id + '/humiture-rt-temp',
    method: 'get'
  })
}

// 生产管理-数据报表-细纱报表-分班次统计报表
export function getXiShaBaoBiao(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/production-report-by-material-xs?begin=' +
      data.begin +
      '&end=' +
      data.end,
    method: 'get'
  })
}

// 指定时间，查询平均纱支变化趋势
export function getXiShaBaoBiaoQuShiTu(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-shift-report/yarn-count-tendency?begin=' +
      data.begin +
      '&end=' +
      data.end,
    method: 'get'
  })
}

/**
 * 各工序-单机详情，指定机台id的list，查询实时信息列表
 */
export function postShiSiXinXinList_qingHua(data) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-real-infos',
    method: 'post',
    data
  })
}

/**
 * 指定机台、开始时间、结束时间，查询设定信息
 */
export function postSheZhiBianGenList(data) {
  return request.request({
    url: '/api/v3.1/business/machine-pt/machine-pt-list',
    method: 'post',
    data
  })
}

// 设备监控-细纱工序-状态总览
export function getZhuangTaiZongLan_xs() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-xs',
    method: 'get'
  })
}

export function getZhuangTaiZongLanAndTongJi_xs() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-xs-statistics',
    method: 'get'
  })
}

// 设备监控-粗纱工序-状态总览
export function getZhuangTaiZongLan_cs() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-cs',
    method: 'get'
  })
}

export function getZhuangTaiZongLanAndTongJi_cs() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-cs-statistics',
    method: 'get'
  })
}

// 设备监控-二并工序-状态总览
export function getZhuangTaiZongLan_eb() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-eb',
    method: 'get'
  })
}

// 设备监控-精梳工序-状态总览
export function getZhuangTaiZongLan_js() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-js',
    method: 'get'
  })
}

// 设备监控-末并工序-状态总览
export function getZhuangTaiZongLan_mb() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-mb',
    method: 'get'
  })
}

export function getZhuangTaiZongLanAndTongJi_mb() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-mb-statistics',
    method: 'get'
  })
}

// 设备监控-预并工序-状态总览
export function getZhuangTaiZongLanAndTongJi_yb() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-yb-statistics',
    method: 'get'
  })
}

// 设备监控-倍捻工序-状态总览
export function getZhuangTaiZongLanAndTongJi_bn() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-bn-statistics',
    method: 'get'
  })
}

// 设备监控-梳棉工序-状态总览
export function getZhuangTaiZongLanAndTongJi_sm() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-sm-statistics',
    method: 'get'
  })
}

// 设备监控-织机工序-状态总览
export function getZhuangTaiZongLan_zj() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-zj',
    method: 'get'
  })
}

// 设备监控-条卷工序-状态总览
export function getZhuangTaiZongLan_tj() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-tbj',
    method: 'get'
  })
}

// 设备监控-气流纺工序-状态总览
export function getZhuangTaiZongLan_qlf() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-qlf',
    method: 'get'
  })
}

// 指定机台id，查询机台基础信息和machinerealinfo信息
export function getShishiCanShu_zj(machineDocumentId) {
  return request.request({
    url: '/api/v3.1/business/loom-production-monitoring/machine-real-info/' + machineDocumentId,
    method: 'get'
  })
}

/**
 * 指定开始班次、结束班次、机台id，查询条桶停车报告
 */
export function postTiaoTongTingCheBaoGao_mb(data) {
  return request.request({
    url: '/api/v3.1/business/barrel-report-mb/barrel-stop-report-mb',
    method: 'post',
    data
  })
}

/**
 * 预并&末并
 * 指定开始班次、结束班次、机台id，查询条桶停车报告
 */
export function postTiaoTongTingCheBaoGao_combine(data, type) {
  const urlStr = { '11870': 'yb', '11570': 'mb' }
  return request.request({
    url: `/api/v3.1/business/barrel-report-${urlStr[type]}/barrel-stop-report-${urlStr[type]}`,
    method: 'post',
    data
  })
}

// 粗纱单锭实时信息
export function getCuShaDanDingShiShiXinXi(data) {
  return request.request({
    url: '/api/v3.1/business/position-info-cs/position-realtime-cs',
    method: 'post',
    data
  })
}

/**
 * 指定班次、机台，查询重复断头次数统计
 */
export function postChongFuDuanTouTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/position-info-cs/break-cnt-statistics-cs',
    method: 'post',
    data
  })
}

/**
 * 指定断头超时时间、机台，查询粗纱断头超时情况
 */
export function postDuanTouCaoShi_CS(data) {
  return request.request({
    url: '/api/v3.1/business/position-info-cs/position-break-over-cs',
    method: 'post',
    data
  })
}

/**
 * 指定班次、机台，查询关闭检测记录
 */
export function postGuanBiJianChaJiLu_CS(data) {
  return request.request({
    url: '/api/v3.1/business/position-info-cs/position-disable',
    method: 'post',
    data
  })
}

// 满纱库实时信息
export function getManShaKuXinXi() {
  return request.request({
    url: '/api/v3.1/business/cxl-real-info/full-spinning-stores-real-info',
    method: 'get'
  })
}

// 尾纱库实时信息
export function getWeiShaKuXinXi() {
  return request.request({
    url: '/api/v3.1/business/cxl-real-info/tail-spinning-stores-real-info',
    method: 'get'
  })
}

// 粗纱库实时信息
export function getCuShaKuXinXi() {
  return request.request({
    url: '/api/v3.1/business/cxl-real-info/cs-spinning-stores-real-info',
    method: 'get'
  })
}

// 粗细联工序-综合报表
export function getCuXiLianZongHeXinXi() {
  return request.request({
    url: '/api/v3.1/business/cxl-real-info/rail-meta-real-info',
    method: 'get'
  })
}

// 细纱工序-锭速电量分析
export function getDinSuDianLiangFenXi(data) {
  return request.request({
    url:
      '/api/v3.1/business/doffing-analysis-appservice/speed-energy-analysis?SpinningStart=' +
      data.SpinningStart +
      '&MachineDocumentId=' +
      data.MachineDocumentId +
      '&DoffingRecordType=' +
      data.DoffingRecordType +
      '&SpinningEnd=' +
      data.SpinningEnd,
    method: 'get'
  })
}

/**
 * 指定机台、班次，查询粗细联换段记录
 */
export function postJiTaiLiShiChaXun_cxl(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-cxl/roving-renew-cxl-by-machine',
    method: 'post',
    data
  })
}

/**
 * 指定机台、物料，查询粗细联换段记录
 */
export function postPingZhongLiShiChaXun_cxl(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-cxl/roving-renew-cxl-by-material',
    method: 'post',
    data
  })
}

/**
 * 查询所有灯光控制设置信息
 */
export function getDengGuagnKongZhiList(craftNodeId) {
  return request.request({
    url: '/api/v3.1/business/light-control-set-record?craftNodeId=' + craftNodeId,
    method: 'get'
  })
}

/**
 * 更新灯光控制设置信息
 */
export function putDengGuangSheZhi(data) {
  return request.request({
    url: '/api/v3.1/business/light-control-set-record',
    method: 'put',
    data
  })
}

/**
 * 获取灯控位置图
 */
export function geDengKongBuJuTu(craftNodeId) {
  return request.request({
    url: '/api/v3.0/basic/light/light-location/' + craftNodeId,
    method: 'get'
  })
}

/**
 *查询细纱灯控实时信息
 */
export function getDengGuagnKongZhiList_xs() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp-light/machine-rttemp-light-xs',
    method: 'get'
  })
}

/**
 * 灯控手动开关灯
 */
export function postDengKongShouDong(data) {
  return request.request({
    url: '/api/v3.1/business/light-control-record/light-control-manual-write',
    method: 'post',
    data
  })
}

/**
 *生产监视-滤尘-状态总览
 */
export function getZhuangTaiZongLian_lvChen() {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-online-lc',
    method: 'get'
  })
}

/**
 * 获取前端可展示的集中回收(回花)详情配置
 */
export function getJiZhongHuiShouXiangQinPeiZhi() {
  return request.request({
    url: '/api/v3.0/basic/machine-document/lap-waste-machine-detail-list',
    method: 'get'
  })
}

/**
 * 根据版本号id或者协议号id 获取设备协议数据
 */
export function getBanBenHaoHuoQuShuJu(id) {
  return request.request({
    url: '/api/v3.0/basic/collect-meta/' + id + '/by-version-id-or-agreement-id?type=0',
    method: 'get'
  })
}

/**
 * 指定工艺节点名称，查询MachineRealInfo实时详情
 */
export function getGongYiJieDianShiShiXiangQin(craftNodeName) {
  return request.request({
    url: '/api/v3.1/business/machine-rttemp/machine-real-info?craftNodeName=' + craftNodeName,
    method: 'get'
  })
}

/**
 * 指定温湿度点位、开始时间、结束时间，查询温湿度历史记录
 */
export function postWenShiDuDianWeiLiShi(data) {
  return request.request({
    url: '/api/v3.1/business/humiture-rt/humiture-rt-by-humidity-id',
    method: 'post',
    data
  })
}

/**
 * 指定菜单编码，查询该租户是否包含该页面
 */
export function getGengJuCaiDanBianMaChaXun(code) {
  return request.request({
    url: '/api/v3.1/business/menu-units/is-has-menu-units?code=' + code,
    method: 'get'
  })
}

/**
 *细纱换段预测甘特图
 */
export function getHuanDuanYuCeGanTeTu(leiXingId) {
  return request.request({
    url:
      '/api/v3.1/business/roving-renew-xs/roving-renew-prediction-gantt-xs?orderModel=' + leiXingId,
    method: 'get'
  })
}

/**
 *指定机台、条数num，查询该机台最近num条换段记录
 */
export function getHuanDuanJiLu_5(machineDocumentId) {
  return request.request({
    url:
      '/api/v3.1/business/roving-renew-xs/roving-renew-history-xs/' + machineDocumentId + '?num=5',
    method: 'get'
  })
}

/**
 *指定换段记录id，查询该条换段记录的细纱换段预测历史记录
 */
export function getHuoQuHuanDuanJiLu(fK_RovingRenewXS) {
  return request.request({
    url:
      '/api/v3.1/business/roving-renew-xs/roving-renew-xs-predict-history-tendency?fK_RovingRenewXS=' +
      fK_RovingRenewXS,
    method: 'get'
  })
}

/**
 *查询换筒预测记录
 */
export function getHuoQuHuanTongYuCeList() {
  return request.request({
    url: '/api/v3.1/business/roving-renew-cs/roving-renew-cs-statistics',
    method: 'get'
  })
}

/**
 *指定开始班次、结束班次，查询粗纱生产计划
 */
export function getCuShaShengChanJiHua(data) {
  return request.request({
    url:
      '/api/v3.1/business/roving-renew-cs/production-plan-cs?TsIdStart=' +
      data.TsIdStart +
      '&TsIdEnd=' +
      data.TsIdEnd,
    method: 'get'
  })
}

/**
 * 新增粗纱剩余落数变化记录
 */
export function postGaiFangChuShaShengYuLuoShu(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-cs/remain-doff-cnt-history-cs',
    method: 'post',
    data
  })
}

/**
 * 新增或修改粗纱生产计划
 */
export function postCuShaShengChanJiHua(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-cs/update-production-plan-cs',
    method: 'post',
    data
  })
}

/**
 * 指定班次、机台、类型，查询开停车编辑记录
 */
export function postKaiTingCheBianJiJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-run-log-edit/machine-run-log-edit',
    method: 'post',
    data
  })
}

/**
 * 编辑开停车记录
 */
export function postBianJiKaiTingCheJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/machine-run-log-edit/machine-run-log-edit',
    method: 'put',
    data
  })
}

/**
 * 编辑开停车记录,可编辑多条记录
 */
export function putBianJiKaiTingCheJiLu_duoXuan(data) {
  return request.request({
    url: '/api/v3.1/business/machine-run-log-edit/machine-run-log-edit2',
    method: 'put',
    data
  })
}

/**
 * 指定编辑记录id，撤销编辑
 */
export function postCeXiaoBianJi(editRecordId) {
  return request.request({
    url: '/api/v3.1/business/machine-run-log-edit/revoke-machine-run-log-edit/' + editRecordId,
    method: 'post'
  })
}

/**
 *指定开始日期、结束日期，查询保养记录
 */
export function getChaXunBaoYangJiLu(data) {
  return request.request({
    url:
      '/api/v3.1/business/machine-up-keep-history/machine-up-keep-history-statistics?Start=' +
      data.Start +
      '&End=' +
      data.End,
    method: 'get'
  })
}

// 查询成品所有标识物及其颜色
export function GetAllBiaoShiWuDuiYing() {
  return request.request({
    url: '/api/order/marker/finished-products-marker-all',
    method: 'get'
  })
}

// 指定开始日期、结束日期，查询成品入库记录
export function GetChengPingRuKuJiLu(data) {
  return request.request({
    url:
      '/api/v3.1/business/finished-products-in-storage-record/finished-products-in-storage-record-statistics?DateStart=' +
      data.DateStart +
      '&DateEnd=' +
      data.DateEnd,
    method: 'get'
  })
}

/**
 * 指定物料id，查询缝包颜色、打包带、纸管、批号默认上一次录入结果。（不传物料id时，返回最近一个月的每个品种的上一次录入结果）
 */
export function postHuoQuShangYiGeYuePingZhongJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/finished-products-in-storage-record/finished-products-in-type-last',
    method: 'post',
    data
  })
}

/**
 * 录入成品入库记录
 */
export function postLuRuChengPingRuKuJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/finished-products-in-storage-record/create-finished-products-in-storage-record',
    method: 'post',
    data
  })
}

// 成品入库中的细纱品种（近三个月的细纱品种+报警纱）
export function GetJingSanYueXiShaPingZhong() {
  return request.request({
    url: '/api/v3.1/business/finished-products-in-storage-record/finished-products-material',
    method: 'get'
  })
}

// 根据键查找对应的配置数据
export function getGenGuJianZhiChaXunDuiYingPeiZhi(str: string) {
  return request.request<{ id: string; key: string; value: string; description: string }>({
    url: '/api/v3.1/business/setting-utils/setting-by-key?keyStr=' + str,
    method: 'get'
  })
}

// 修改指定日期的入库记录
export function putXiuGaiRiQiDeRuKuJiLu(data) {
  return request.request({
    url: '/api/v3.1/business/finished-products-in-storage-record/finished-products-in-storage-record-by-date',
    method: 'put',
    data
  })
}

// 删除指定日期的入库记录
export function deleteZhiDingRiQiDeRuKuJiLu(date) {
  return request.request({
    url:
      '/api/v3.1/business/finished-products-in-storage-record/finished-products-in-storage-record-by-date?date=' +
      date,
    method: 'delete'
  })
}

/**
 * 用户录入的换段记录插入
 */
export function postHuanDuanJiLuChaRu(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-xs/roving-renew-xSBy-user-insert',
    method: 'post',
    data
  })
}

// 修改用户录入的换段记录插入记录
export function putXiuGaiHuanDuanJiLuChaRu(data) {
  return request.request({
    url: '/api/v3.1/business/roving-renew-xs/roving-renew-xSBy-user-insert',
    method: 'put',
    data
  })
}

// 辐库实时信息
export function getFuKuShiShiXingXi() {
  return request.request({
    url: '/api/v3.1/business/cxl-real-info/auxiliary-spinning-stores-real-info',
    method: 'get'
  })
}

/**
 * 根据机台 开始 结束时间 查询锭速与千锭时断头
 */
export function postDingSuAndQianDingShiDuanTou(data) {
  return request.request({
    url: '/api/v3.1/business/machine-shift-break-report/break-cnt-speed',
    method: 'post',
    data
  })
}

/**
 * 新排班设置
 */
export function postPaiBanSheZhi_xin(data) {
  return request.request({
    url: '/api/v3.1/business/shift-change-area-machine-asso',
    method: 'post',
    data
  })
}

// 指定id删除区域
export function deletePaiBanGuanLi_xin(id) {
  return request.request({
    url: '/api/v3.1/business/shift-change-area-machine-asso/' + id,
    method: 'delete'
  })
}

// 根据设备id删除区域内的设备
export function deleteQuYuNeiSheBei_xin(id) {
  return request.request({
    url: '/api/v3.1/business/shift-change-area-machine-asso/shift-change-area-machine/' + id,
    method: 'delete'
  })
}

// 获取排班设备信息按照工艺节点分组展示(全部设备)
export function getGongXuAndJiTaiFenZuZhanShi() {
  return request.request({
    url: '/api/v3.1/business/shift-change-area-machine-asso/craft-machine-list',
    method: 'get'
  })
}

// 获取已设置区域
export function getYiSheZhiQuYu() {
  return request.request({
    url: '/api/v3.1/business/shift-change-area-machine-asso/shift-change-area-list',
    method: 'get'
  })
}

/**
 * 指定班次、机台，查询单锭断头累计时间统计
 */
export function postDanDingDuanTouTongJi(data) {
  return request.request({
    url: '/api/v3.1/business/position-info-cs/position-break-statistics-cs',
    method: 'post',
    data
  })
}

// 指定开始时间和结束时间，获取原料出库单
export function getZhiDingTimeHuoQuChuKuDan(data) {
  return request.request({
    url: '/api/craft/cotton-info/out-cotton-store?Begin=' + data.Begin + '&End=' + data.End,
    method: 'get'
  })
}

/**
 * 新增出库单
 */
export function postXinZengChuKuDan(data) {
  return request.request({
    url: '/api/craft/cotton-info/out-cotton-store',
    method: 'post',
    data
  })
}

/**
 * 指定出库单id，撤销出库单
 */
export function postCeXiaoChuKuDan(outCottonStoreId) {
  return request.request({
    url: '/api/craft/cotton-info/revoke-out-cotton-store/' + outCottonStoreId,
    method: 'post'
  })
}

// 获取库存信息
export function getHuoQuKuCunXinXi() {
  return request.request({
    url: '/api/craft/cotton-info/cotton-store-inventory',
    method: 'get'
  })
}

// 获取库存统计信息
export function getHuoQuKuCunTongJiXinXi() {
  return request.request({
    url: '/api/craft/cotton-info/cotton-store-inventory-statistics',
    method: 'get'
  })
}

/**
 * 指定开始班次、结束班次、机台列表，查询粗纱一络纱过程记录表
 */
export function postCuShaYiLuoShaJiLuBiao(data) {
  return request.request({
    url: '/api/v3.1/business/machine-spinning-process-cs/machine-spinning-process-cs',
    method: 'post',
    data
  })
}
